var rotateRight = function (head, k) {
  let fast = head,
    slow = head;
  // fast 先走 k 步
  while (k--) {
    if (fast && fast.next) fast = fast.next;
    else fast = head;
  }
  // slow == fast说明 k 会被链表长度整除，故无需操作 head 直接返回即可
  if (slow === fast) return head;
  // 快慢指针 start
  while (fast.next) {
    slow = slow.next;
    fast = fast.next;
  }
  // 对慢指针位置进行打断
  fast.next = head;
  head = slow.next;
  slow.next = null;
  return head;
};
